let VALID_KEYS = [
  // init data
  'getChanneltypes'
];

let validateKey = function (key) {
  if ($.inArray(key, VALID_KEYS) < 0)
    throw new Error('无效的键名：' + key);
};

let KEY_PREFIX = 'Class.sessions.';

class ClassSessions {
  set(key, value) {
    validateKey(key);
    this._set(key, value);
  }

  _set(key, value) {
    Session.set(KEY_PREFIX + key, value);
  }

  get(key) {
    validateKey(key);
    return Session.get(KEY_PREFIX + key);
  }
};

export default AppSessions = new ClassSessions();